package com.java.module.fire.service.impl;

import java.util.Collections;
import java.util.List;
import com.java.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.java.module.fire.mapper.LikeMapper;
import com.java.module.fire.domain.Like;
import com.java.module.fire.service.ILikeService;

/**
 * 收藏点赞Service业务层处理
 * 
 * @author Administrator
 * @date 2025-02-10
 */
@Service
public class LikeServiceImpl implements ILikeService {
    @Autowired
    private LikeMapper likeMapper;

    /**
     * 查询收藏点赞
     * 
     * @param likeId 收藏点赞ID
     * @return 收藏点赞
     */
    @Override
    public Like selectLikeById(Long likeId) {
        return likeMapper.selectLikeById(likeId);
    }

    /**
     * 查询收藏点赞
     *
     * @param like 收藏点赞
     * @return 收藏点赞
     */
    @Override
    public Like selectLikeOne(Like like) {
        return likeMapper.selectLikeOne(like);
    }

    /**
     * 查询收藏点赞列表
     * 
     * @param like 收藏点赞
     * @return 收藏点赞
     */
    @Override
    public List<Like> selectLikeList(Like like) {
        return likeMapper.selectLikeList(like);
    }

    /**
     * 新增收藏点赞
     * 
     * @param like 收藏点赞
     * @return 结果
     */
    @Override
    public int insertLike(Like like) {
        like.setCreateTime(DateUtils.getNowDate());
        return likeMapper.insertLike(like);
    }

    /**
     * 修改收藏点赞
     * 
     * @param like 收藏点赞
     * @return 结果
     */
    @Override
    public int updateLike(Like like) {
        like.setUpdateTime(DateUtils.getNowDate());
        return likeMapper.updateLike(like);
    }

    /**
     * 批量删除收藏点赞
     * 
     * @param likeIds 需要删除的收藏点赞ID
     * @return 结果
     */
    @Override
    public int deleteLikeByIds(Long[] likeIds) {
        return likeMapper.deleteLikeByIds(likeIds);
    }

    /**
     * 删除收藏点赞信息
     * 
     * @param likeId 收藏点赞ID
     * @return 结果
     */
    @Override
    public int deleteLikeById(Long likeId) {
        return likeMapper.deleteLikeById(likeId);
    }

    @Override
    public List<Like> selectLikeListPost(Like like) {
        return likeMapper.selectLikeListPost(like);
    }

    @Override
    public List<Like> selectLikeListUser(Like like) {
        return likeMapper.selectLikeListUser(like);
    }
}
